define(function (require) {
var zsApp= require('app'); 
zsApp.controller( 'goodsaddController',["$scope","$http","$state","$stateParams","$window","$timeout", "$rootScope",function($scope,$http,$state,$stateParams,$window,$timeout,$rootScope){
		$scope.goods_resourcesselectlevelList == 0;
		$scope.goods_resourcesselectlevelTwoList = 0;
		$scope.goods_resourcesselectlevelTwoListTwo = 0;
		//goods 一级select
		$scope.goods_resourcesselectlevelList = [{"id":0,"name":"资源"},{"id":1,"name":"资源分类"}];
		//goods 二级级select
		$scope.goods_resourcesselectlevelTwoList = [{"id":0,"name":"不限制"},{"id":1,"name":"计量销售"},{"id":2,"name":"包时间"}];
		$scope.goods_resourcesselectlevelTwoListTwo = [{"id":0,"name":"不限制"},{"id":1,"name":"包分类"},{"id":2,"name":"包时间"},,{"id":3,"name":"包年段"}];
		
		$scope.goodsdates = [];
		$scope.goodsdates.push(
		{
			goodsName:"资源A",
			goodsType:0,
			salesType:0,
  		},
  		{
			goodsName:"资源B",
			goodsType:0,
			salesType:1,
  		},
  		{
			goodsName:"资源c",
			goodsType:0,
			salesType:2,
  		}
  		);
  		
  		$scope.deletetr = function($index){		
			if($scope.goodsdates.length == 1){
				// 操作提示
					$rootScope.prompt = true;
					$rootScope.promptStatement = "最后一行了";
					$timeout(function () {
						$rootScope.prompt = false;
						$rootScope.success = false;
					}, 1500);
			
			}else{
				$scope.goodsdates.splice($index,1);
			}
		}
	
}])
})